package com.hmall.common.client;


import com.hmall.common.dto.Item;
import com.hmall.common.dto.PageDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@FeignClient("itemservice")
public interface ItemClient {

    @GetMapping("/item/{id}")
    Item findById(@PathVariable Long id);

    @PostMapping("/item")
    void update(@RequestBody Item item);

    @GetMapping("/item/list")
    PageDTO<Item> page(Integer page, Integer size);
}